using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Xml.Serialization;

namespace OpenPanekitEditor
{
    public class Settings
    {
        public string PluginFolder = AppDomain.CurrentDomain.BaseDirectory+"Plugin";
        public int PhysicsUpdateRate = 4;
        public Schemas.ControlerAssignExport ControlerAssign;

        public void Save(string filename)
        {
            Stream stream = File.Create(filename);

            XmlSerializer serializer = new XmlSerializer(typeof(Settings));
            serializer.Serialize(stream, this);
            stream.Close();
        }
        public Settings Load(string filename)
        {
            Stream stream = File.OpenRead(filename);
            XmlSerializer serializer = new XmlSerializer(typeof(Settings));
            Settings settings = (Settings)serializer.Deserialize(stream);
            stream.Close();
            return settings;
        }
    }
}
